<?php
require_once($_SERVER['DOCUMENT_ROOT']."/inc/Function.php");
if(DEFINED($_GET['m'])){
	$moudel = constant($_GET['m']);
	include_once($_SERVER['DOCUMENT_ROOT']."/inc/".$moudel."_class.php");
	$class = new $moudel();	
	if(is_callable(array($class,$_GET['a']))){
		$fun = $_GET['a'];
		$class->{$fun}($_POST);
	}else{
		header("HTTP/1.1 404 Not Found");
		header("Status: 404 Not Found");
		exit;
	}
}
else{
header("HTTP/1.1 404 Not Found");
echo json_encode($str);
}
?>